pub use crate::http::{self, Result, StatusCode};
use std::convert::TryInto;
use std::fmt::Debug;

mod into_response;

pub use into_response::IntoResponse;

#[derive(Debug)]
pub struct Response {
    pub(crate) res: http::Response,
    // tracking here
    // pub(crate) cookie_events: Vec<CookieEvent>,
}

impl Response {
    pub fn new<S>(status: S) -> Self
    where
        S: TryInto<StatusCode>,
        S::Error: Debug,
    {
        let res = http::Response::new(status);
        Self { res }
    }
}

impl From<Response> for http::Response {
    fn from(value: Response) -> Self {
        value.res
    }
}
